package com.ruoyi.shop.modules.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @Author: JinChen Zhu
 * @CreateTime: 2024-07-03  12:42
 */
public interface UserDataMapper {
    //通过字段名和字段值统计数量
    @Select("SELECT COUNT(*) FROM sys_user WHERE ${field} = #{value}")
    int countByField(@Param("field") String field, @Param("value") String value);

    @Select("SELECT COUNT(*) FROM sys_user")
    int countAll();

    //查询几0后的人数
    @Select("SELECT COUNT(*) FROM sys_user WHERE substr(birthday,3,1) = #{age}")
    int countAge(@Param("age") String age);
}
